﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using System.Data;

namespace WpfApplication2
{
    class AdoOperation
    {
        public DataTable GetTableData(string Commandtext,string ConnString)
        {
            try
            {
                DataTable table = new DataTable();
                SqlConnection conn = new SqlConnection(ConnString);
                SqlCommand cmd = new SqlCommand(Commandtext, conn);
                conn.Open();
                SqlDataReader reader = cmd.ExecuteReader();
                table.Load(reader);
                conn.Close();
                return table;
            }
            catch (Exception ex)
            {
                
                throw ex;
            }
           
        }
    }
}
